import React, {Component} from 'react';

/**
 * react高阶组件
 * @returns {Element}
 * @constructor
 */
const ReactHoc = function (props) {
    return (
        <>
            <div>
                {Object.keys(props).map((item,index) => {
                    return <li key={index}>{item}</li>
                })}
            </div>
        </>
    )

};

const ReactHocProxy = function (Component) {
    return function HOC(props){
        return (
            <Component
                {...props}/>
        )
    }
}


export default ReactHocProxy(ReactHoc);